﻿using UnityEngine;
using System.Collections;

public class GameController: MonoBehaviour {

	// Use this for initialization
	public GameObject prefab;
	void Start () {
		Invoke ("SpawnGold", 5);
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	public void QiutGame(){
		Application.Quit ();
	}
	void SpawnGold(){
		Vector3 pos = new Vector3 (Random.Range(-4f, 5.5f), 0.9f, Random.Range(-7.5f, 10f)); 

		Instantiate (prefab, pos, prefab.transform.rotation);

		Invoke ("SpawnGold", 5);
	}
}
